import VueRouter from 'vue-router'
//导入组件
import home from './component/Tabbar/home.vue'
import search from './component/Tabbar/search.vue'
import shopcar from './component/Tabbar/shopcar.vue'
import user from './component/Tabbar/user.vue'
import news from './component/news/news.vue'
import newsinfo from './component/news/newsinfo.vue'
import photolist from './component/photos/photolist.vue'
import photoinfo from './component/photos/photoinfo.vue'
import goodslist from './component/goods/goodslist.vue'
import goodsinfo from './component/goods/goodsinfo.vue'
import goodsdes from './component/goods/goodsdes.vue'
import goodscomment from './component/goods/goodscomment.vue'


// 3. 创建路由对象
var router = new VueRouter({
    routes: [{
            path: "/",
            redirect: "/home"
        },
        {
            path: "/home",
            component: home
        },
        {
            path: "/search",
            component: search
        },
        {
            path: "/shopcar",
            component: shopcar
        },
        {
            path: "/user",
            component: user
        },
        {
            path: "/home/news",
            component: news
        },
        {
            path: "/home/newsinfo/:id",
            component: newsinfo
        },
        {
            path: "/home/photolist",
            component: photolist
        },
        {
            path: "/home/photoinfo/:id",
            component: photoinfo
        },
        {
            path: "/home/goodslist",
            component: goodslist
        },
        {
            path: "/home/goodsinfo/:id",
            component: goodsinfo,
            name: "goodsinfo"
        },
        {
            path: "/home/goodsdes/:id",
            component: goodsdes,
            name: "goodsdes"
        },
        {
            path: "/home/goodscomment/:id",
            component: goodscomment,
            name: "goodscomment"
        }

    ],
    linkActiveClass: "mui-active"
})

// 把路由对象暴露出去
export default router